Implement application cleanup context (``app.cleanup_ctx`` property).